package controlador;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import vista.VentanaPrincipal;;

public class ControladorVentanaPrincipal implements ActionListener {

	private VentanaPrincipal ventanaMenu;
	
	public ControladorVentanaPrincipal() {
		super();
		this.ventanaMenu = new VentanaPrincipal();
		this.ventanaMenu.setLocationRelativeTo(null);
		this.ventanaMenu.setVisible(true);	
		this.ventanaMenu.addListener(this);
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		String actionCommand = e.getActionCommand();
		if (actionCommand.equals("Salir")) {
			System.exit(0);
		}		
		else if (actionCommand.equals("Orden")) {
			new ControladorVentanaOrden();
		}
		else if (actionCommand.equals("Producto")){
			new ControladorVentanaProducto();
		}
		else if (actionCommand.equals("Categoria")) {
			new ControladorVentanaCategoria();
		}
		else if (actionCommand.equals("Insumos")){
			new ControladorVentanaCompra();
		}
		else if (actionCommand.equals("Listado de Ingrediente")){
			new ControladorVentanaListadoIngrediente();
		}
		else if (actionCommand.equals("Listado de Ventas")){
			new ControladorVentanaListadoVenta();
		}
	}

}